package com.cskaoyan.controller.wxcontroller;

import com.cskaoyan.bean.po.AdminInfoBean;
import com.cskaoyan.bean.po.LoginUserData;
import com.cskaoyan.bean.common.BaseRespVo;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author jackX
 * @datetime 2022/12/31 19:37
 * @description: TODO:
 */
@RestController
@RequestMapping("wx/auth")
public class AuthWeChatController {
    @PostMapping("login")
    public BaseRespVo<LoginUserData> login(@RequestBody Map map) {
        String username = (String) map.get("username");
        String password = (String) map.get("password");
        // 写业务
        LoginUserData loginUserData = new LoginUserData();
        AdminInfoBean adminInfo = new AdminInfoBean();
        adminInfo.setAvatar("https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        adminInfo.setNickName("admin123");
        loginUserData.setAdminInfo(adminInfo);
        loginUserData.setToken("c4d988f3-e4c5-4e46-b6ce-13b9e008ea20");
        return BaseRespVo.ok(loginUserData);
    }
}
